#include<iostream>
using std::cout;
using std::cin;
using std::endl;

struct Node
{
	int m;
	int * num;
	int sum;
};

typedef struct Node Line;

int main(void)
{
	Line * line;
	int n,i,j;
	cin >> n;
	line = new Line[n];
	for( i=0;i<n;i++)
	{
		cin >> line[i].m;
		line[i].num = new int[line[i].m];
		line[i].sum = 0;
		for( j=0;j<line[i].m;j++)
		{
			cin >> line[i].num[j];
			line[i].sum += line[i].num[j];
		}
	}
	for( i=0;i<n;i++ )
	{
		cout << line[i].sum <<endl;
		delete [] line[i].num;
	}
	delete [] line;
	return 0;
}